Skip to content

fix(toolbar): center the connection chip with the visible window title#1543

Merged
datlechin merged 1 commit into
mainfrom
fix/toolbar-centered-item
Jun 1, 2026
Merged

fix(toolbar): center the connection chip with the visible window title#1543
datlechin merged 1 commit into
mainfrom
fix/toolbar-centered-item

Conversation

@datlechin
Copy link
Copy Markdown
Member

Follow-up to #1479.

Problem

After #1479 made the window title visible (titleVisibility = .visible on the .unified toolbar), every toolbar item jumped to the right edge: the leading group, the centered connection chip, and the trailing actions all bunched up on the right, with a large empty gap after the title.

Cause

The toolbar centered the connection chip (principal) by bracketing it with two .flexibleSpace items. That splits the toolbar's free width in half to center the chip, which only works while the window title is hidden. With the title now drawn in the leading area of the same unified toolbar row, it takes a greedy chunk of leading width, the flexible-space split no longer balances against the real leading edge, and everything after the title collapses to the trailing edge.

Fix

Use NSToolbar.centeredItemIdentifiers (macOS 13+, the app targets 14.0), which centers an item relative to the window independently of the title and the other items. The two .flexibleSpace items around principal are replaced with a single .flexibleSpace that pushes the trailing action cluster right.

Layout is now: leading group on the left, connection chip centered, actions on the right, coexisting with the visible title.

centeredItemIdentifiers is applied at runtime, so it re-centers the chip even for a toolbar whose autosaved configuration still holds the old arrangement.

@datlechin datlechin merged commit 4497589 into main Jun 1, 2026
2 of 3 checks passed
@datlechin datlechin deleted the fix/toolbar-centered-item branch June 1, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant